﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace TemplateWeb.Helpers
{
    public static class WebConfiguration
    {
        /// <summary>
        /// Returns the maximum number of products to be displayed on a page
        /// </summary>
        public static int ProductsPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["ProductsPerPage"]);
            }
        }

        public static int NumInfoPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumInfoPerPage"]);
            }
        }

        /// <summary>
        /// // Returns the length of descriptions in info lists
        /// </summary>
        public static int InfoContentLength
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["InfoContentLength"]);
            }
        }

        /// <summary>
        /// Returns the length of product descriptions in products lists
        /// </summary>
        public static string SiteName
        {
            get
            {
                return ConfigurationManager.AppSettings["SiteName"];
            }
        }

        /// <summary>
        /// Returns the address of the mail server 
        /// </summary>
        public static string MailServer
        {
            get
            {
                return ConfigurationManager.AppSettings["MailServer"];
            }
        }

        /// <summary>
        /// Send error log emails? 
        /// </summary>
        public static bool EnableErrorLogEmail
        {
            get
            {
                return bool.Parse(ConfigurationManager.AppSettings["EnableErrorLogEmail"]);
            }
        }

        /// <summary>
        /// Returns the email address where to send error reports 
        /// </summary>
        public static string ErrorLogEmail
        {
            get
            {
                return ConfigurationManager.AppSettings["ErrorLogEmail"];
            }
        }

        public static string EmailLienHe { get; set; }
        public static string PasswordEmailLienHe { get; set; }

        public static int NumQuanLyPerPage
        {
            get
            {
                return Int32.Parse(ConfigurationManager.AppSettings["NumQuanLyPerPage"]);
            }
        }
    }
}